]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: fix wireless-enabled property notifications
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 8 Oct 2013 19:23:30 +0000 (21:23 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 8 Oct 2013 20:20:27 +0000 (22:20 +0200)
The property is on the NMClient, not NMDevice. Also, make sure
we disconnect the signal when the item is destroyed.
Also, connect to wireless-hardware-enabled, which we'll use soon.

https://bugzilla.gnome.org/show_bug.cgi?id=709635

js/ui/status/network.js

index 6a2efc9a08ae8f075c612b2a06be90e3b44d52b8..26aa81616eeb78e58897eae7ef1c73cbd71a76ca 100644 (file)
@@ -971,7 +971,8 @@ const NMDeviceWireless = new Lang.Class({
 
         this.item.menu.addSettingsAction(_("Network Settings"), 'gnome-network-panel.desktop');
 
-        this._wirelessEnabledChangedId = this._device.connect('notify::wireless-enabled', Lang.bind(this, this._sync));
+        this._wirelessEnabledChangedId = this._client.connect('notify::wireless-enabled', Lang.bind(this, this._sync));
+        this._wirelessHwEnabledChangedId = this._client.connect('notify::wireless-hardware-enabled', Lang.bind(this, this._sync));
         this._activeApChangedId = this._device.connect('notify::active-access-point', Lang.bind(this, this._activeApChanged));
         this._stateChangedId = this._device.connect('state-changed', Lang.bind(this, this._deviceStateChanged));
 
@@ -991,6 +992,14 @@ const NMDeviceWireless = new Lang.Class({
             this._activeAccessPoint.disconnect(this._strengthChangedId);
             this._strengthChangedId = 0;
         }
+        if (this._wirelessEnabledChangedId) {
+            this._client.disconnect(this._wirelessEnabledChangedId);
+            this._wirelessEnabledChangedId = 0;
+        }
+        if (this._wirelessHwEnabledChangedId) {
+            this._client.disconnect(this._wirelessHwEnabledChangedId);
+            this._wirelessHwEnabledChangedId = 0;
+        }
 
         this.item.destroy();
     },